home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / dviware / dvidoc / zed-example.out < prev    next >
Text File  |  1994-04-24  |  11KB  |  289 lines

  1.                               ZED (Zohar EDitor)
  2.  
  3.                                A. Bruce Langdon
  4.                               Physics Department
  5.                     Lawrence Livermore National Laboratory
  6.  
  7.  
  8.           ZED is an interactive code, able to read, manipulate and dis-
  9.      play graphically the time-dependent data from simulation codes.
  10.      ZED was begun in 1974 by B. Langdon and B. Lasinski to postpro-
  11.      cess time history files from runs of ZOHAR, a 2D electromagnetic
  12.      particle-in-cell code.  At Berkeley, Princeton and Livermore MFE it
  13.      was applied and extended in imaginative ways to other codes by W.
  14.      Nevins, N. Otani,..., and others.  In its original (1974-1987) form,
  15.      the commands were individually interpreted in LRLTRAN, adding new
  16.      commands was clumsy, and the command syntax was stilted.  The ver-
  17.      sions at LCC (the internal Livermore center) and at NMFECC evolved
  18.      separately for years.  In 1987 Nevins suggested that ZED be re-
  19.      born as a Basis `package'.  Basis is a combined interactive inter-
  20.      preter/graphics/code system to which anyone can readily add commands
  21.      and the Fortran subprograms to implement them.  This document de-
  22.      scribes the Basis implementation of ZED.
  23.  
  24.  
  25.                                  Availability
  26.  
  27.      At MFECC, ZED for the Cray-2 is publicly available from CFS directory
  28. /ZOHAR/CRAY2/ZED.  The files include:
  29.      XZED is the executable file.
  30.      ZEDLIB is a LIB file which includes ZEDMAC, the part of ZED written in
  31. the Basis language, and the sources files needed to make XZED. Also, ZED.TEX
  32. is the TeX source for this manual; ZED.DOC (what you are reading now) is a
  33. straight ASCII file to print or view on a terminal.  EBAL is a Basis-language
  34. file; read after INIT, it will read and display the various particle and field
  35. energies and fluxes and form an energy balance.  PBAL is like EBAL, but for
  36. the x-component of momentum.
  37.  
  38.  
  39.                               How to use ZED now
  40.  
  41.      First, get a copy of the Basis system manual[1] and read the first chap-
  42. ter.
  43.      Commands implemented now let you create Basis variables that contain the
  44. time histories of physical variables from their time histories saved in the
  45. HISTORY and STATE files.  You then have the full power of Basis to do as you
  46. will with them.  This already empowers you to do much of what old ZED did, and
  47. much more that it didn't.
  48.      The time dependence of many quantities in the simulation is written into
  49. the file HISTORY. The file STATE contains in addition the time step, particle
  50. species' names, etc, and descriptive information about the simulation (plus
  51. other data like the electromagnetic fields that pertains only to the time step
  52. when the state file was made.)  HISTORY and STATE are not human readable text
  53.  
  54.  
  55.  
  56. 11/21/1988
  57. ZED
  58.  
  59. files, they hold numbers and text in Cray hardware representation.(a)  The
  60. Fortran functions GETSTATE and GETHIST, together with the Basis-language func-
  61. tions INIT, READH, etc., read from STATE and HISTORY and create Basis vari-
  62. ables holding the interesting values.
  63.  
  64. INIT      The first command you give is INIT. Often the files are renamed to
  65.           indicate the problem name (e.g., HPROB, SPROB) or time step (e.g.,
  66.           H6000, S6000).  Then you run `INIT PROB' or `INIT 6000'.
  67.  
  68. GET       A list of variables to be read from HISTORY is accumulated.  Vari-
  69.           able `ELG' is added to the list by the command `GET ELG'. This
  70.           translates to `GETS("ELG")'.  You may call `GETS' directly if the
  71.           variable name is computed.  For example, `GETS("KE"//FORMAT(IS,0))'
  72.           when IS=2 adds `KE2' to the list.
  73.  
  74. READH     This command takes the list accumulated by the `GET' commands, reads
  75.           from HISTORY, and creates Basis arrays holding the time series.  In
  76.           the example above, after readh there will be two new arrays, ELG and
  77.           KE2.  You then could do `PLOT ELG, TIME' to plot the electrostatic
  78.           field energy versus time.
  79.  
  80. STEPS FIRST, LAST [, ISKIP]  Usually READH reads from step 0 to the last
  81.           step of the simulation.  This command confines the times steps to
  82.           (FIRST,LAST). Optionally it resets ISKIP, whose meaning is that only
  83.           time steps that are multiples of ISKIP are retained.  If ISKIP=2,
  84.           then e.g., ELG(I) corresponds to time step 2I and ELG is subscripted
  85.           roughly (FIRST/2:LAST/2).
  86.           If indexed variables are to be used, ISKIP must be a multiple of
  87.           ISMODE (see MODES).
  88.  
  89. MODES     HISTORY is divided into two parts.  The first holds time records for
  90.           quantities that are more or less global, like kinetic energy for all
  91.           electrons, or are particular, like the x position of a planar shock.
  92.           The records present are printed by INIT. The second part holds time
  93.           records of quantities that have a name and one or two indices, like
  94.           a field at a particular grid point, or a coordinate of a particle.
  95.           The list in human-readable form is in array LBLM.
  96.           At present, GET and READH work with only one part at a time.  You
  97.           toggle between them with the MODES command.
  98.           Values in the modes section are not in general saved every time
  99.           step, but at steps that are multiple of ISMODE, an input variable
  100.           to ZOHAR. In ZOHAR by default ISMODE=2.
  101.  
  102. PLOTH XYZ  plots history variable XYZ versus time.  If XYZ is a complex vari-
  103.           able, the real and imaginary parts are plotted using solid and
  104.           dashed lines in the lower half of the frame.  In the upper half, the
  105.           modulus squared is plotted, semilog.  (Of course you can also use
  106.           the Basis plot interface.)
  107. ----------------------------
  108.  (a) The format  of HISTORY and STATE is  indicated in source  files SZEDC and
  109. VAR.ZED in  ZEDLIB, and of  course in  the ZOHAR routines  WRITSTAT, READSTAT,
  110. TSET and MDSET.
  111.  
  112.  
  113.  
  114. 11/21/1988                             2
  115. ZED
  116.  
  117.           If XYZ is from the history file, i.e., it is in the VARSH or VARSM
  118.           list, it is labelled instead with the corresponding ``nice'' name
  119.           from LBLH or LBLM (see `Variable naming').
  120.  
  121. SPECT(F)  Value is the Blackman-Tukey power spectra of time variable F. To
  122.           get spectrum for subinterval of the full time step range (IS-
  123.           TEPL,ISTEPU), do SPECT(F(IL:IU)). Remember, IL and IU are the actual
  124.           steps divided by ISKIP.
  125.  
  126. SPARAM LAGWIDTH [DATAWIDTH [WMAX]]  Set lag window and data window widths (in
  127.           steps) and maximum frequency to be displayed by default in spectrum
  128.           plots.
  129.  
  130. INTS VAR [WMIN WMAX]  (Soon) Integrate spectrum in VAR. Useful in finding out
  131.           how much power is between two frequencies.
  132.  
  133. MEM       (Later) Form `maximum entropy method' spectra.
  134.  
  135. RESET     Clears memory.  Might be used before switching to another ZOHAR run.
  136.  
  137. FLL       Prints ZED's memory size.
  138.  
  139.  
  140.                                Variable naming
  141.  
  142.  
  143.      ZOHAR history records include items whose names have blanks or charac-
  144. ters not legal in Basis variables:  `FIELD PX', `EX-EY'. So you must refer to
  145. `FIELDPX' and `EXEY' instead.  Worse, indexed records have a name and two in-
  146. dices, and an index may be negative.  For example, `BZ(X,KY) 20 3' is field
  147. Bz, Fourier transformed over y, evaluated at x grid point 20, mode 3.  This
  148. is stored in Basis variable `BZXK20$3'.  The $ separates the two indices.  In
  149. a negative index number, a % replaces the minus.  Arrays VARSH and VARSM hold
  150. the list of these ugly things for globals and modes, respectively, while LBLH
  151. and LBLM hold the list of nice names.  You may wish to use Basis' DEFINE so
  152. you can refer to these by nicer names.
  153.  
  154.  
  155.                          ZOHAR's variables in HISTORY
  156.  
  157.  
  158.      While the modes variables are entirely specified by user input and there
  159. may not even be any, the global variables are chosen by statements at the be-
  160. ginning of subroutine TSET. These vary slightly from version to version and
  161. the number of particle species, but the following are standard:
  162.  
  163. N1, N2, ...   are the number of active particles of species 1, 2, ...
  164.  
  165. KE1, PX1, KE2, ...   are the kinetic energies and momenta of active particles
  166.      of species 1, 2, ...
  167.  
  168.  
  169.  
  170.  
  171.  
  172. 11/21/1988                             3
  173. ZED
  174.  
  175. KL1, KL2, ...   are cumulative kinetic energies of particles of species 1,
  176.      2, ...  lost due to particles leaving through the left or right side.
  177.      Particles entering make a negative contribution.
  178.  
  179. L PXL1, R PXL1, ...   are cumulative x momenta of particles of species 1 lost
  180.      due to particles leaving through the left or right side, respectively.
  181.      Particles entering make a negative contribution.
  182.  
  183.      ..and similarly for PY1, etc.
  184.  
  185. FIELD PX  Electromagnetic momenta in x direction, etc.
  186.  
  187. L PXLF, R PXLF  cumulative fluxes of the x component of the field momentum
  188.      out of the system, i.e.  the time integral of the Maxwell stress tensor
  189.      averaged averaged over y at the left and right sides.
  190.  
  191. ELG, EX-EY, BZ  field energies associated with the `electrostatic' field, Ex
  192.      plus Ey, and Bz, respectively.
  193.  
  194. WLEYBZ, WREYBZ  cumulative Poynting fluxes.  The electromagnetic energies into
  195.      the left side and out through the right side, averaged over y.
  196.  
  197.      ..and similarly for BX-BY, EZ, WLEZBY and WREZBY.
  198.  
  199. BZ LEFT, BZ RIGHT  is Bz averaged over y at the left and right sides.  The
  200.      contribution of the incoming electromagnetic waves is subtracted; this
  201.      only really works in vacuum.
  202.  
  203.      ..and similarly for EZ LEFT and EZ RIGHT.
  204.  
  205. CLOCK  is the real clock time in decimal hours.  Use this to review your
  206.      strategies for getting production time.
  207.  
  208.      In the relativistic shock version (CODE = ``zirs''), there are in addi-
  209. tion:
  210.  
  211. L BFLUX, R BFLUX  Cumulative magnetic field flux through the left and right
  212.      sides.
  213.  
  214. XSHOCK
  215.  
  216. Notes
  217.      The energies and momenta are the totals divided by Ly in versions peri-
  218. odic in y, and by LxLy in versions periodic in x and y.
  219.  
  220.  
  221.                                   The future
  222.  
  223.  
  224.      User experience will guide evolution of ZED and of this report.
  225.      It would not be difficult to teach ZED to read field information from
  226. STATE and to read the particle files.
  227.  
  228.  
  229.  
  230. 11/21/1988                             4
  231. ZED
  232.  
  233.                                Customizing ZED
  234.  
  235.      The simplest customization is to add your own functions and macros in a
  236. file to be read by Basis in addition to ZEDMAC.
  237.      Other versions of ZOHAR, and other codes that write HISTORY files, have
  238. STATE laid out differently, or no STATE file at all.  You can revise INIT and
  239. GETSTATE accordingly; all the files are available in CFS.
  240.  
  241.  
  242.                                Acknowledgements
  243.  
  244.      ZED derives its extensibility and its new power from the Basis system.
  245. We are grateful for additions to Basis that ZED depends on.
  246.  
  247.  
  248.                                   References
  249.  
  250.  
  251.  [1] P. Dubois, Z. Motteler, P. Willmann et al, ``The Basis System'', LLNL
  252.      report M-225, available on-line at the LCC and NMFECC.
  253.  
  254.  [2] ZOHAR is described in ``Electromagnetic and Relativistic Plasma Simula-
  255.      tion Models'', A. B. Langdon and B. F. Lasinski, in Methods in Computa-
  256.      tional Physics, ed. by B. Alder, S. Fernbach and M. Rotenberg, vol. ed.
  257.      J. Killeen, (Academic Press, New York, 1976), Vol. 16, p. 327-366.
  258.  
  259.  
  260.                            Appendix:  How it works
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288. 11/21/1988                             5
  289.